import { request } from '@/utils/request'
// 获取用户地址列表
export const getAddressList = () => request('Memberaddress/address_list')
// 获取单条用户地址信息
export const getAddressInfo = addressId =>
  request('/Memberaddress/address_info', {
    address_id: addressId
  })
// 新增用户收货地址
export const addAddress = data =>
  request('/Memberaddress/address_add', {
    address_realname: data.address_realname,
    area_id: data.area_id,
    city_id: data.city_id,
    area_info: data.area_info,
    province_id: data.province_id,
    address_detail: data.address_detail,
    address_longitude: data.address_longitude,
    address_latitude: data.address_latitude,
    address_tel_phone: data.address_tel_phone,
    address_mob_phone: data.address_mob_phone,
    address_is_default: data.address_is_default
  })
// 编辑用户收货地址
export const editAddress = (data, addressId) =>
  request('/Memberaddress/address_edit', {
    address_id: addressId,
    address_realname: data.address_realname,
    area_id: data.area_id,
    city_id: data.city_id,
    area_info: data.area_info,
    address_detail: data.address_detail,
    address_longitude: data.address_longitude,
    address_latitude: data.address_latitude,
    address_tel_phone: data.address_tel_phone,
    address_mob_phone: data.address_mob_phone,
    address_is_default: data.address_is_default
  })
// 删除用户收货地址
export const delAddress = addressId =>
  request('/Memberaddress/address_del', {
    address_id: addressId
  })
